#include "stack.h"

int Push( ElemType data, SqStack *stack ){
    if( stack->top == MAX_STACK_SIZE ){
        printf("stack over flow!");
        return -1;
    }

    stack->top ++;
    stack->data[stack->top] = data;

    return 0;
}


int Pop( ElemType *data, SqStack *stack ){
    if( stack->top == -1 ){
        // printf("no elements to pop!");
        return -1;
    }

    *data = stack->data[stack->top];
    stack->top --;
    return 0;
}